package main

import (
	"fmt"
	"strconv"
)

//This person struct type has name and age fields.
type person struct {
	name string
	age  int
}

func (this *person) f() {
	fmt.Println(this.name + strconv.Itoa(this.age))
}
func main() {

	//Access struct fields with a dot.
	s := person{name: "Sean", age: 50}
	s.f()
	s2 := &person{name: "wall", age: 20}
	s2.f()
	//You can also use dots with struct pointers - the pointers are automatically dereferenced.
	sp := &s
	sp.f()
	//sp1 := &s2
	//sp1.f()
}
